package top.novel.ioc.factory;

import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.name.Names;
import top.novel.strategy.HQB5WebStrategy;
import top.novel.strategy.IStrategy;
import top.novel.strategy.Miaojiang8Strategy;
import top.novel.strategy.QB5WebStrategy;

import static com.google.inject.Scopes.SINGLETON;

/**
 * @author xuhainan
 * @date 2022/8/15 14:22
 * @region hefei
 */
public class StrategyModule extends AbstractModule {

    @Override
    protected void configure() {
        Binder binder = binder();
        binder.bind(IStrategy.class).annotatedWith(Names.named("miaojiang8Strategy")).to(Miaojiang8Strategy.class).in(SINGLETON);
        binder.bind(IStrategy.class).annotatedWith(Names.named("qB5WebStrategy")).to(QB5WebStrategy.class).in(SINGLETON);
        binder.bind(IStrategy.class).annotatedWith(Names.named("hQB5WebStrategy")).to(HQB5WebStrategy.class).in(SINGLETON);
    }
}
